package com.hualian.ticket.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 陈静
 * @date 2020/10/20 11:15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
// 利用JPA的注解关联tb_ticket表
@Table(name = "tb_ticket")
public class Ticket implements Serializable {
    @Id
    @Column(name = "tkt_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)   // 设置id主键的策略为IDENTITY,作为自动增长策略
    private Integer id;
    @Column(name = "tkt_name")
    private String name;
    @Column(name = "tkt_desc")
    private String desc;
    @Column(name = "tkt_role")
    private String role;
    @Column(name = "tkt_collectExpire")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date collectExpire;
    @Column(name = "tkt_useExpire")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date useExpire;
    @Column(name = "tkt_img")
    private String img;
    @Column(name = "tkt_state")
    private Boolean state;
}
